names = (InvitationRequest.find :all,
 :conditions => "open_space_participation = true and status = 'accepted'").collect { |r| r.person.name }

puts names.collect{ |n|
	words = n.split
	if words.length > 2
		words[0] = "#{words[0]} #{words[1]}"
		words[1] = words[2]
	end
	
	"#{words[1]},#{words[0]}"
}.sort